import App from './App';
import { createSSRApp } from 'vue';
import * as Pinia from 'pinia';

export function createApp() {
	const app = createSSRApp(App);
	app.use(Pinia.createPinia());

	return {
		app,
		Pinia, // 此处必须将 Pinia 返回
	}
}

// 普通提示
uni.showNoneToast = function(title) {
	uni.showToast({ icon: 'none', title });
}

// 成功提示
uni.showSuccessToast = function(title, callback) {
	uni.showToast({
		icon: 'success',
		title,
		success: () => {
			if (typeof callback === 'function') {
				setTimeout(callback, 1500);
			}
		}
	});
}